<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!-- 使用JSTL标签需要引入的头文件 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!-- 使用fmt 对时间进行格式化的时候需要引入的头文件 -->
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function diaryDelete(diaryId){
		if(confirm("您确定要删除这个日志吗？")){
			window.location="diary?action=delete&diaryId="+diaryId;
		}
	}
</script>
</head>
<body>
<div class="data_list">
		<!-- 日志信息表头 -->
		<div class="data_list_title">
			<img src="${pageContext.request.contextPath}/images/diary_show_icon.png"/>日记信息
		</div>
		<div>
			<!-- 日志信息标题 -->
			<div class="diary_title"><h3>${diary.title }</h3></div>
			<div class="diary_info">
				发布时间:『<fmt:formatDate value="${diary.releaseDate }" type="date" pattern="yyyy-MM-dd HH:mm:ss"/>』&nbsp;&nbsp;日志类别:${diary.typeName }
			</div>
			<!-- 日志信息内容 -->
			<div class="diary_content">
				${diary.content }
			</div>
			<!-- 日志信息修改 -->
			<div class="diary_action">
				<button class="btn btn-primary" type="button" onclick="javascript:window.location='diary?action=preSave&diaryId=${diary.diaryId}'">修改日志</button>
				<button class="btn btn-primary" type="button" onclick="javascript:history.back()">返回</button>
				<button class="btn btn-danger" type="button" onclick="diaryDelete(${diary.diaryId})">删除日志</button>
			</div>
		</div>
</div>
</body>
</html>